//this source is written by mark on 2013/10/22
/*
 *INFO:
 *	is to represent the buffer queue to store the packet
 *	notice the Linked_queue is different and it's head is always not empty
 *
 *Author:
 *	Mark on 2013/10/22
 *	<mark199312@gmail.com>
 */

/*
 *code log:
 *	2014/3/22
 *	to add the record_key_t on 
 *	
 *	2014/4/1
 *	to add the tail in buff_queue 
 *
 */

#ifndef BUFF_QUEUE_H
#define BUFF_QUEUE_H

#include<stdio.h>
#include"use_hash.h"
#include"log.h"

struct record_key;

struct buff_queue_node
{
	//convience for the fib search
	struct record_key *key;
	
	unsigned long arrive_time;
	struct buff_queue_node *next;
	char *packet;
	int packet_len;
};

struct buff_queue
{
	struct buff_queue_node *head;
	struct buff_queue_node *tail;

	unsigned long count;
};


extern void buff_queue_init(struct buff_queue ** buffer_queue);
extern void buff_queue_add(struct buff_queue * buffer_queue,struct buff_queue_node *node);
extern struct buff_queue_node* buff_queue_del(struct buff_queue * buffer_queue);
extern int buff_queue_count(struct buff_queue *buffer_queue);

#endif


